package reflect;


import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

public class ReflectDemo6
{
    public static void main(String[] args) throws Exception
    {
        Class aClass = Class.forName("reflect.Person");
        int modifiers = aClass.getModifiers();

        switch (modifiers)
        {
            case Modifier.PUBLIC:
                System.out.println("public");
                break;
            case Modifier.PROTECTED:
                System.out.println("protected");
                break;
            case Modifier.PRIVATE:
                System.out.println("private");
                break;
            default:
                System.out.println("default");
                break;
        }

        Method say = aClass.getMethod("say", String.class, int.class);
        System.out.println(say.getParameterCount());
        Class[] parameterTypes = say.getParameterTypes();
        for (Class c : parameterTypes)
        {
            System.out.println(c);
        }

    }
}
